<template>
	<view class="bz p-2">
		<view class="list mb-2 p-2 bz b-radius1 bg-white d-flex flex-nowrap" v-for="(item,index) in list" :key="index">
			<view class="flex-1">
				<view class="title py-1">{{item.projectName}}</view>
				<view class="solid-bottom text-xs py-1">
					<text class="text-gray">{{item.createTime}}</text>
				</view>
				
				<view class="d-flex flex-nowrap a-center">
					<view class="name">服务技师:</view>
					<view class="name pl-2">
						{{item.technicianName}}
					</view>
				</view>

			</view>
			<view class="">
				<view class='cu-tag light bg-gray b-radius1'>已完成</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				total:0
			}
		},
		onLoad() {
			this.getinfo();
		},
		methods: {
			getinfo(){
				
				if(uni.getStorageSync('user')==null || uni.getStorageSync('user')==''){
					uni.showToast({
						title: '请先登录',
						icon: "none"
					});
					return;
				}
				
				
				var arr= {
					openId :uni.getStorageSync('user').openId,
							curr:1,
							pageSize:10
						};
					arr=JSON.stringify(arr)
				this.$http({
						url: '/IWeiXinService.queryOrderList',
						method: 'post',
						data: arr
					}).then((res) => {
						console.log(res)
						if(res.code==0){
							this.list=res.data;
							this.total=res.count
						}else if(res.code=='100003'){
					uni.showToast({title:res.msg, icon:"none"});
					setTimeout(function(){
						uni.navigateTo({
						    url: "/pages/bind_phone/bind_phone"
						});
					},1000)
				}else if(res.code=='100004'){
					uni.showToast({title:res.msg, icon:"none"});
					setTimeout(function(){
						uni.navigateTo({
							 url: "/pages/login/login"
						})
					},1000)
				}
				
					}).catch((err) => {
						console.log(err)
					
					})
			}
		}
	}
</script>

<style>
page {
background: rgba(242,244,247,1);
height: 100%;

}
.title{
	font-weight: bold;
	color: #333;
}

.name{
	font-size: 28rpx;
}

</style>
